{{--<div class="bjui-pageHeader" style="background-color:#fefefe; border-bottom:none;">--}}
{{--<form data-toggle="ajaxsearch"--}}
{{--data-options="{url:'urcbwyjr/personnel/company-address-list',searchDatagrid:$.CurrentNavtab.find('#company-address-list')}">--}}
{{--<fieldset>--}}
{{--<legend style="font-weight:normal;">企业搜索：</legend>--}}
{{--<div style="margin:0; padding:1px 5px 5px;">--}}
{{--<span>承租人：</span>--}}
{{--<input type="text" name="name" class="form-control" size="20">--}}
{{--<button type="submit" class="btn-green" data-icon="search">开始搜索！</button>--}}
{{--<button type="reset" class="btn-orange" data-icon="times">重置</button>--}}
{{--</div>--}}
{{--</fieldset>--}}
{{--</form>--}}
{{--</div>--}}
<div class="bjui-pageContent">
    <table id="pass-flow-list" class="table table-bordered" data-toggle="datagrid" data-options="{
        height: '100%',
        dataUrl: '/admin/personnel/pass-flow-list',
        {{--delUrl: '/admin/personnel/resume/apply-del',--}}
    {{--delPK: 'id',--}}
            paging: {showPagenum:10, selectPageSize:'20,50,100', pageCurrent:1, pageSize:20},
            fullGrid: true,
            linenumberAll: true,
            filterThead:false,
            fieldSortable:false,
            columnMenu:false,
            showCheckboxcol:true,
            showToolbar: true,
            toolbarCustom: toolbar,
            }">
        <thead>
        <tr>
            <th data-options="{name:'name',align:'center',width:100}">姓名</th>
            <th data-options="{name:'department',align:'center',width:100}">部门</th>
            <th data-options="{name:'position',align:'center',width:100}">职位</th>
            <th data-options="{align:'center',width:100,render:operationColumn}">操作</th>
        </tr>
        </thead>
    </table>
</div>

<script type="text/javascript">
    function operationColumn(value, data) {
        var html = '<button type="button" class="btn btn-blue" data-toggle="dialog" data-options="{id:\'join-company\', url:\'/admin/personnel/join-company\', width:440, height:225, fresh:true, title:\'加入公司\', data:{id:' + data.id + '}}"><i class="fa fa-plus"></i> 加入公司</button>';
        return html;
    }
    function toolbar(value, data) {
        var html = '<button type="button" class="btn btn-blue" onclick="batchJoinCompany()"><i class="fa fa-plus"></i> 将所选人员添加到公司</button>';
        return html;
    }
    function batchJoinCompany()
    {
        var selectedDatas = $("#pass-flow-list").data('selectedDatas');
        var tmp = [];
        if (selectedDatas != undefined && selectedDatas != false) {
            for (var i = 0; i < selectedDatas.length; i++) {
                tmp[i] = selectedDatas[i].id;
            }
            BJUI.dialog({
                id:'batch-join-company',
                url:'/admin/personnel/join-company',
                width: 405,
                height: 360,
                mask:true,
                title: '批量加入公司',
                data:{id:tmp}
            });
        } else {
            BJUI.alertmsg('info', '未选中任何项！')
        }
    }
</script>